#pragma once

#include "includeBase.h"
#include "../common/BasePclModel.h"

class ExtractingIndicesModel : public BasePclModel
{
public:
    ExtractingIndicesModel();

public:
    static ExtractingIndicesModel& get();

public: // IJsonSerializable
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    QJsonObject toJson() const override;

public: // Property
    QString pcdFile() const { return pcdFile_; }
    void setPcdFile(const QString& pcdFile) { pcdFile_ = pcdFile; }

    double leafSizeForX() const { return leafSizeForX_; }
    void setLeafSizeForX(double leafSizeForX) { leafSizeForX_ = leafSizeForX; }

    double leafSizeForY() const { return leafSizeForY_; }
    void setLeafSizeForY(double leafSizeForY) { leafSizeForY_ = leafSizeForY; }

    double leafSizeForZ() const { return leafSizeForZ_; }
    void setLeafSizeForZ(double leafSizeForZ) { leafSizeForZ_ = leafSizeForZ; }

    int maxIterations() const { return maxIterations_; }
    void setMaxIterations(int maxIterations) { maxIterations_ = maxIterations; }

    double distanceThreshold() const { return distanceThreshold_; }
    void setDistanceThreshold(double distanceThreshold)
    {
        distanceThreshold_ = distanceThreshold;
    }

    double keepRatio() const { return keepRatio_; }
    void setKeepRatio(double keepRatio) { keepRatio_ = keepRatio; }

private:
    QString pcdFile_ = "<pcl-data>/tutorials/table_scene_lms400.pcd";

    double leafSizeForX_ = 0.01;
    double leafSizeForY_ = 0.01;
    double leafSizeForZ_ = 0.01;
    int maxIterations_ = 1000;
    double distanceThreshold_ = 0.01;
    double keepRatio_ = 0.3;
};
